<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableSiteLocationWhiteList extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('site_location_white_list', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('rmsUserId')->default(0)->comment('用户ID');
            $table->json('appPower')->nullable()->comment('APP 权限配置');
            $table->json('pcPower')->nullable()->comment('PC 权限配置');
            $table->unsignedTinyInteger('status')->default(0)->comment('状态 0-正常 1-停用');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '选址白名单配置';

            $table->index('rmsUserId', 'idx_rmsUserId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('site_location_white_list');
    }
}
